﻿using System;
using System.Data.OracleClient;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBUtility;

/* 登录日志
 
 
*/

namespace OracleDAL.QuanXian
{
    public class Log
    {
        #region 添加日志
        public int AddLog(string userisn, string userName, string userIP, string userMac, string logonSucceed)
        {
            //用时间加三位随机数表示
            string logisn = DateTime.Now.ToString("yyyyMMddHHmmss");
            Random rd = new Random();
            logisn = logisn + rd.Next(0,999).ToString();

            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into sec_Logonlog (LogIsn,userIsn,username,UserIP,userMac,logonTime,logonsucceed) values ('" + logisn + "','" + userisn + "','" + userName + "','" + userIP + "','" + userMac + "',sysdate,'" + logonSucceed + "')");

            return OracleHelper.ExecuteSql(strSql.ToString());
        }
        #endregion
    }
}
